<!DOCTYPE html>
<html> 

	<head>
		<meta charset="UTF-8">
		<title>经销商</title> 
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta http-equiv="Cache-Control" content="no-transform">
		<meta name="format-detection" content="telephone=no">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<link rel="stylesheet" href="style/css/basic.css" />
		<link rel="stylesheet" href="style/css/dealer_details.css" />
		<script type="text/javascript" src="style/plugin/mui/js/mui.min.js"></script>
		<script type="text/javascript" src="style/js/jquery-1.8.3.min.js"></script>
		<script type="text/javascript" src="style/mockjs/dist/mock.js"></script>
		<script type="text/javascript" src="style/js/vue.min.js"></script>
		<script type="text/javascript" src="style/js/vue-resource.js"></script>
		<script type="text/javascript" src="style/js/basic.js"></script>
	</head>  
	<body>   
		<div id="sales">
		    <div class="topbg">
				<div id="header" style="position: relative;"> 
					<h1>经销商</h1> 
					<span class="backicon"></span>
				</div> 
				<div class="title">
					<img :src="htp+agentdel.head" class="head_portrait" v-if="agentdel!=''"/>  
					<span>{{agentdel.nickname}}</span>
				</div>
			</div>
			<div class="details"> 
				<ul>  
					<li>
						<span class="concact">联系人</span>
						<span>{{agentdel.nickname}}<em class="fr">{{agentdel.phone}}</em></span>
	
					</li>
					<li>
						<span class="serial">系统编号</span>
						<span>{{agentdel.mem_no}}</span>
					</li>
					<li>
						<span class="address" @tap="jumporder">经销商订单</span>
						<!--<span>{{agentdel.address}}</span>-->
					</li>
					<li v-if="agentdel!=''">
						<span class="verification">未核销</span>
						<span>{{agentdel.order_total.check_num}}
						<a href="javascript:;" @tap="jumpscanHe">核销</a>
						</span>
					</li>
					<!--<li v-if="agentdel!=''">
						<span class="warehouse">未入库</span>
						<span>
							{{agentdel.num-agentdel.sale_num}}
							<a href="javascript:;" @tap="jumpscanIn">入库</a>
						</span>
					</li>-->
	
				</ul>
			</div>	
		</div>
		
		<script>
			new Vue({
				el:"#sales",
				data:{
					agentdel:"",
					htp:"",
					ticket:"",
				    sign:""
				},
				methods:{
					jumpscanHe:function(){
						var that=this
						mui.plusReady(function(){
						    mui.openWindow({
								url: "scan_out.html",
								id:"sale_out",
//								extras:{ 
//									cur:4,
//									mem:that.agentdel.mem_no
//								},
								show: {
									autoShow: true, //页面loaded事件发生后自动显示，默认为true
									aniShow: "slide-in-right", //页面显示动画，默认为slide-in-right；
									duration: 200 //页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
								},
								createNew:true,
								waiting:{
							        autoShow:false//自动显示等待框，默认为true
							        
						        } 
							})	
						})
					},
					jumpscanIn:function(){
						var that=this
						mui.plusReady(function(){
						    mui.openWindow({
								url: "sale_agent_order.html",
								id:"sale_agent_order",
								extras:{
									cur:2,
									mem:that.agentdel.mem_no
								},
								show: {
									autoShow: true, //页面loaded事件发生后自动显示，默认为true
									aniShow: "slide-in-right", //页面显示动画，默认为slide-in-right；
									duration: 200 //页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
								},
								createNew:true,
								waiting:{
							        autoShow:false//自动显示等待框，默认为true
							        
						        }
							})	
						})
					},
					jumporder:function(){
						var that=this
						mui.plusReady(function(){
						    mui.openWindow({
								url: "sale_agent_order.html",
								id:"sale_agent_order",
								extras:{
									cur:0,
									mem:that.agentdel.mem_no
								},
								show: {
									autoShow: true, //页面loaded事件发生后自动显示，默认为true
									aniShow: "slide-in-right", //页面显示动画，默认为slide-in-right；
									duration: 200 //页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
								},
								createNew:true,
								waiting:{
							        autoShow:false//自动显示等待框，默认为true
							        
						        }
							})	
						})
						
					}
				},
				created:function(){
					var that=this
					that.htp=domain2
					this.ticket=localStorage.getItem("tick")
                    this.sign=localStorage.getItem("sig")
					mui.plusReady(function(){
						var aId=plus.webview.currentWebview().current;
//						alert(aId)
//						alert(aId)
						that.$http.post(domain+"/saler/getAgentInfo?t="+that.ticket+"&sign="+that.sign,{
							agent_no:aId
						},{emulateJSON:true}).then(//获取快讯数据
				            function (res) {
				                // 处理成功的结果
				                if(res.body.code==1){
				                  console.log(res.body)	
				                  that.agentdel=res.body.data;
				                } 
				            },function (res) {
				            // 处理失败的结果
				            console.log(res) 
				            }
				        );
					})
				} 
			})
			
		</script>
	</body>

</html>